<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>统一认证页面</title>
</head>
<body>
	<h2>统一认证页面</h2>
	<small>（如何自定义登录页面？1. 在项目目录工程的静态资源路径中添加名称为 facade-signIn.html 的；2. 通过 lym.security.browser.signInPage=xxx.html，然后在资源路径中添加 xxx.html）</small>
	<h3>用户名密码登录</h3>
	<small>（默认从UserService中取，demo中的实现：用户名不限制，密码为 password）</small>
	<form action="/authentication/form" method="post">
		<table>
			<tr>
				<td>用户名:</td> 
				<td><input type="text" name="username"></td>
			</tr>
			<tr>
				<td>密码:</td>
				<td><input type="password" name="password" value="password"></td>
			</tr>
			<tr>
				<td>图形验证码:</td>
				<td>
					<input type="text" name="imageCode">
					<img src="/code?type=imageCode"><small>(默认可空，pom.xml 引入 `learn-security-starter-code` 后，则表单登录必须填正确的验证码才能成功登录。并支持短信验证码登录)</small>
				</td>
			</tr>
			<tr>
				<td colspan='2'>
					<!-- name 固定，spring-security 定义 -->
					<input name="remember-me" type="checkbox" value="true" />记住我
					<small>（勾选该项后，即使关闭浏览器，在1个月内，不必认证也可以直接访问，即自动登录）</small>
				</td>
			</tr>
			<tr>
				<td colspan="2"><button type="submit">登录</button></td>
			</tr>
		</table>
	</form>
	
	<h3>短信登录</h3>
	<form action="/authentication/sms" method="post">
		<table>
			<tr>
				<td>手机号:</td>
				<td><input type="text" name="phoneNumber" value="13012345678"></td>
			</tr>
			<tr>
				<td>短信验证码:</td>
				<td>
					<input type="text" name="smsCode">
					<button type="button" onclick="down()">发送验证码</button>
				</td>
			</tr>
			<tr>
				<td colspan='2'><input name="remember-me" type="checkbox" value="true" />记住我</td>
			</tr>
			<tr>
				<td colspan="2"><button type="submit">登录</button></td>
			</tr>
		</table>
	</form>
	<br>
	<h3>社交登录</h3>
	<a href="/auth/qq">QQ登录</a>
	&nbsp;&nbsp;&nbsp;&nbsp;
	<a href="/auth/weixin">微信登录</a>
</body>
<script>
    function down(){
        var url = "http://192.168.1.101:9090"
        var request = new XMLHttpRequest();
        request.open("POST", "/code?type=smsCode&phoneNumber=13012345678");
        request.send("F")
    }
</script>
</html>